using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RoomDoor : MonoBehaviour
{
    public Room parent_Room;
    public direction direction;
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("Player"))
        {
            if (!parent_Room.neighbor.ContainsKey(direction))return;
            CameraController.Instance.ChangeTarget(parent_Room.neighbor[direction].transform);
            collision.gameObject.transform.position = parent_Room.neighbor[direction].transform.position;
        }
    }
}
